package de.boldt.neanda.engine.core;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

public class EngineManager
{
	public static BufferedImage[] loadImage(String path, int picCount)
	{
		BufferedImage[] model = new BufferedImage[picCount];
		BufferedImage source = null;
		
		File f = new File(path);
		try
		{
			source = ImageIO.read(f);
		}
		catch(IOException e)
		{
			e.printStackTrace();
		}
		
		for(int i = 0; i < model.length; i++)
		{
			model[i] = source.getSubimage(i * source.getWidth() / picCount, 0, source.getWidth() / picCount, source.getHeight());
		}
		return model;
	}
}
